package IC.asm.operands;

import IC.asm.Visitor;

public class MachineReg extends RegOperand {
	public enum Regs {
		eax,
		ebx,
		ecx,
		edx,
		ebp,
		esp,
		esi,
		edi;
	};
	
	private Regs reg;
	
	/**
	 * create a specific register
	 */
	public MachineReg(Regs reg) {
		this.reg = reg;
	}
	
	/**
	 * @return the reg
	 */
	public Regs getReg() {
		return reg;
	}

	@Override
	public <D, U> U accept(Visitor<D, U> v, D d) {
		return v.visit(this, d);
	}
	
	@Override
	public boolean equals(Object o)
	{
		if (! (o instanceof MachineReg) )
			return false;
		return reg.equals( ((MachineReg)o).reg );
	}
}
